//
//  QZHomeFollowUserCell.m
//  shortvideoplay
//
//  Created by tikeios_002 on 2024/7/22.
//

#import "QZHomeFollowUserCell.h"

@implementation QZHomeFollowUserCell

- (void)showOldAddNavViewToMainOldView1{
    UIView * oldBgSS = [[UIView alloc]initWithFrame:CGRectMake(0, 0, 0, 0)];
    oldBgSS.clipsToBounds = YES;
    [self addSubview:oldBgSS];
    
    UIButton * sendBtn = [[UIButton alloc]initWithFrame:CGRectMake(KScreen_W-75, kStatusBarHeight+10, 60, 46)];
    sendBtn.layer.cornerRadius = 3;
    sendBtn.backgroundColor = [UIColor whiteColor];
    [sendBtn setTitle:@"发送" forState:UIControlStateNormal];
    [sendBtn setTitleColor:ColorHex(@"#333333") forState:UIControlStateNormal];
    sendBtn.titleLabel.font = [UIFont systemFontOfSize:16];
    [sendBtn addTarget:self action:@selector(sendTap) forControlEvents:UIControlEventTouchUpInside];
    [oldBgSS addSubview:sendBtn];
    
    UIView * sendBg = [[UIView alloc]initWithFrame:CGRectMake(15, kStatusBarHeight+66, KScreen_W-30, (KScreen_H-KSafeAreaBottomHeight-25-(kStatusBarHeight+66))/2)];
    sendBg.backgroundColor = [UIColor whiteColor];
    sendBg.layer.cornerRadius = 3;
    [oldBgSS addSubview:sendBg];
    
    UILabel * sendTip = [[UILabel alloc]initWithFrame:CGRectMake(0, (sendBg.frame.size.height-40)/2, sendBg.frame.size.width, 40)];
    sendTip.text = @"发送区";
    sendTip.textColor = ColorHex(@"#f0f0f0");
    sendTip.textAlignment = NSTextAlignmentCenter;
    sendTip.font = [UIFont systemFontOfSize:28];
    [sendBg addSubview:sendTip];
}
- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}
- (void)configUserModel:(QZUserInfoModel *)model{
    if([model.isfollow intValue] == 1){
//        _QZ_followButton.selected = YES;
        [_QZ_followButton setTitle:@"已关注" forState:UIControlStateNormal];
        [_QZ_followButton setTitleColor:TextTipColor forState:UIControlStateNormal];
        _QZ_followButton.backgroundColor = COLOR(243,240,244);
    }else{
//        _QZ_followButton.selected = NO;
        [_QZ_followButton setTitle:@"关注" forState:UIControlStateNormal];
        [_QZ_followButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
        _QZ_followButton.backgroundColor = MainColor;
    }
    [self.QZ_videoImage sd_setImageWithURL:KUrlString(model.image)];
    [self.QZ_userImage sd_setImageWithURL:KUrlString(model.face) placeholderImage:KImageNamed(@"ic_head_defuls")];
    self.QZ_userName.text = model.nickname;
}
- (IBAction)homeFollowUserClick:(UIButton *)sender {
    if (self.QZUserFollowHomeBlock) {
        self.QZUserFollowHomeBlock(sender.tag);
    }
}
@end
